package com.zhouyusunquan.observer.jdk;


import java.util.Observable;

public class WeatherData extends Observable {
	
	private float temperatrue;
	
	private float humidity;
	
	private float pressure;
	
	public WeatherData(){};
	
	public void measurementsChanged(){
		setChanged();
		notifyObservers();
	}
	
	public float getTemperature(){
		return temperatrue;
	}
	
	public float getHumidity(){
		return humidity;
	}
	
	public float getPressure(){
		return pressure;
	}
	
	
	// 天气发生变化
	public void setMeasurements(float temperature, float humidity, float pressure){
		this.temperatrue = temperature;
		this.humidity = humidity;
		this.pressure = pressure;
		measurementsChanged();
	}

}
